package controllers

import javax.inject.Inject
import play.api.mvc.{AbstractController, ControllerComponents}
import play.api.routing.JavaScriptReverseRouter

/**
 * Created by yz on 11/5/2020
 */
class AppController @Inject()(cc: ControllerComponents) extends  AbstractController(cc){

  def toIndex = Action { implicit request =>

//    println("in")

    Ok(views.html.index())
  }



  def javascriptRoutes = Action { implicit request =>
    Ok(
      JavaScriptReverseRouter("jsRoutes")(

        controllers.routes.javascript.BrowseController.getAllGeneTypes,
        controllers.routes.javascript.BrowseController.browse,
        controllers.routes.javascript.BrowseController.getAllJunctionByServer,
        controllers.routes.javascript.BrowseController.getAllJunctionTypes,
        controllers.routes.javascript.BrowseController.getAllAnnotation,
        controllers.routes.javascript.BrowseController.getAllTumorTypes,
        controllers.routes.javascript.BrowseController.downloadAllJunction,

        controllers.routes.javascript.SearchController.getAllGeneSymbols,
        controllers.routes.javascript.SearchController.keywordSearch,
        controllers.routes.javascript.SearchController.searchResultBefore,
        controllers.routes.javascript.SearchController.generateGenePatternImage,
        controllers.routes.javascript.SearchController.getGenePatternImage,
        controllers.routes.javascript.SearchController.getAllJunctionByGeneSymbol,
        controllers.routes.javascript.SearchController.detailInfoBefore,
        controllers.routes.javascript.SearchController.getJunctionById,
        controllers.routes.javascript.SearchController.generateGeneFusionImage,
        controllers.routes.javascript.SearchController.checkInFusionSymbols,
        controllers.routes.javascript.SearchController.checkInModalSymbols,
        controllers.routes.javascript.SearchController.generateTcgaImage,
        controllers.routes.javascript.SearchController.generateGtexImage,
        controllers.routes.javascript.SearchController.getAllKind,
        controllers.routes.javascript.SearchController.generateBoxplotImage,
        controllers.routes.javascript.SearchController.generateSurvivalImage,
        controllers.routes.javascript.SearchController.getAllLsJunctionByGeneSymbol,
        controllers.routes.javascript.SearchController.getAllBsJunctionByGeneSymbol,
        controllers.routes.javascript.SearchController.getAllFsJunctionByGeneSymbol,
        controllers.routes.javascript.SearchController.getFsJunctionById,
        controllers.routes.javascript.SearchController.getBsJunctionById,
        controllers.routes.javascript.SearchController.getLsJunctionById,
        controllers.routes.javascript.SearchController.getDetailLsById,
        controllers.routes.javascript.SearchController.getDetailFsById,
        controllers.routes.javascript.SearchController.getDetailBsById,
        controllers.routes.javascript.SearchController.searchResultBefore,
        controllers.routes.javascript.SearchController.getAllChr,
        controllers.routes.javascript.SearchController.advancedFilter,
        controllers.routes.javascript.SearchController.png2pdf,
        controllers.routes.javascript.SearchController.image2jpeg,
        controllers.routes.javascript.SearchController.image2svg,
        controllers.routes.javascript.SearchController.checkInGtex,
        controllers.routes.javascript.SearchController.checkInTcga,

        controllers.routes.javascript.StatisticController.getLsFsStatData,
        controllers.routes.javascript.StatisticController.getStatData,

        controllers.routes.javascript.HelpController.getFileData,

        controllers.routes.javascript.DownloadController.downloadData,


      )
    ).as("text/javascript")
  }


}
